* Wealth index calculation. Trevor Croft, 06/30/2021. India NFHS 2019-20. cd 'C:\Users\21180\OneDrive - ICF\Projects\Analysis\Wealth Index Construction\IA2019-20 (Jun 2021)\Wealth'. include file='wealth_assets.sps'. missing values QH65 (999.9). execute. set tvars=both. * Macro definitions to perform some recoding automatically. * Note: Do not use an asterisk in front of a macro name to try to comment it out - it will run any way because of the way the macros are expanded. * Delete the line instead or change the spelling of the macro in the comment. * Do not use the names of macros in comments - they will also be expanded too, and likely will fail. *{Create binary variables based on condition and give label }. define dichotomize( !positional !enclose('(',')') / !positional !tokens(1) / !positional !tokens(1) ) compute !2=0. if (!1) !2=1. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *(Separate shared toilets from non-shared toilets). define shared_fac( !positional !tokens(1) / !positional !tokens(1) / !positional !tokens(1) ). compute !2 = 0. do if (QH42=1). + if (!1=1) !2 = 1. + compute !1 = 0. end if. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *{Reset missing values to 'does not have', change 2 code to 0}. define no2zero( !positional !tokens(1) ) if (missing(!1) | !1<>1) !1=0. value labels !1 0 'No' 1 'Yes'. !enddefine. *{Construct Variables}. * Source of drinking water. dichotomize (QH34=11) QH34_11 "Source of drinking water: Piped - into dwelling". dichotomize (QH34=12) QH34_12 "Source of drinking water: Piped - into yard / plot". dichotomize (QH34=13) QH34_13 "Source of drinking water: Piped - to neighbour". dichotomize (QH34=14) QH34_14 "Source of drinking water: Piped - public tap / standpipe". dichotomize (QH34=21) QH34_21 "Source of drinking water: Tube well / borehole". dichotomize (QH34=31) QH34_31 "Source of drinking water: Dug well - protected". dichotomize (QH34=32) QH34_32 "Source of drinking water: Dug well - unprotected". dichotomize (QH34=41) QH34_41 "Source of drinking water: Spring water - protected". dichotomize (QH34=42) QH34_42 "Source of drinking water: Spring water - unprotected". dichotomize (QH34=51) QH34_51 "Source of drinking water: Rainwater". dichotomize (QH34=61) QH34_61 "Source of drinking water: Tanker truck". dichotomize (QH34=71) QH34_71 "Source of drinking water: Cart with small tank". dichotomize (QH34=81) QH34_81 "Source of drinking water: Surface water (river / dam / lake / pond / stream / canal / irrigation channel)". dichotomize (QH34=91) QH34_91 "Source of drinking water: Bottled water". dichotomize (QH34=92) QH34_92 "Source of drinking water: Community RO Plant". dichotomize (QH34=96) QH34_96 "Source of drinking water: Other". * Type of toilet facility. dichotomize (QH40=11) QH40_11 "Type of toilet facility: Flush - to piped sewer system". dichotomize (QH40=12) QH40_12 "Type of toilet facility: Flush - to septic tank". dichotomize (QH40=13) QH40_13 "Type of toilet facility: Flush - to pit latrine". dichotomize (QH40=14) QH40_14 "Type of toilet facility: Flush - to somewhere else". dichotomize (QH40=15) QH40_15 "Type of toilet facility: Flush - don't know where". dichotomize (QH40=21) QH40_21 "Type of toilet facility: Ventilated Improved Single Pit (VIP) / biogas latrine". dichotomize (QH40=22) QH40_22 "Type of toilet facility: Single pit latrine - with slab". dichotomize (QH40=23) QH40_23 "Type of toilet facility: Single pit latrine - without slab / open pit". dichotomize (QH40=31) QH40_31 "Type of toilet facility: Twin pit / composting toilet". dichotomize (QH40=41) QH40_41 "Type of toilet facility: Dry toilet". dichotomize (QH40=51) QH40_51 "Type of toilet facility: No facility / uses open space / or field". dichotomize (QH40=96) QH40_96 "Type of toilet facility: Other". shared_fac QH40_11 QH40_11_sh "Type of toilet facility: Flush - to piped sewer system - shared". shared_fac QH40_12 QH40_12_sh "Type of toilet facility: Flush - to septic tank - shared". shared_fac QH40_13 QH40_13_sh "Type of toilet facility: Flush - to pit latrine - shared". shared_fac QH40_14 QH40_14_sh "Type of toilet facility: Flush - to somewhere else - shared". shared_fac QH40_15 QH40_15_sh "Type of toilet facility: Flush - don't know where - shared". shared_fac QH40_21 QH40_21_sh "Type of toilet facility: Ventilated Improved Single Pit (VIP) / biogas latrine - shared". shared_fac QH40_22 QH40_22_sh "Type of toilet facility: Single pit latrine - with slab - shared". shared_fac QH40_23 QH40_23_sh "Type of toilet facility: Single pit latrine - without slab / open pit - shared". shared_fac QH40_31 QH40_31_sh "Type of toilet facility: Twin pit / composting toilet - shared". shared_fac QH40_41 QH40_41_sh "Type of toilet facility: Dry toilet - shared". shared_fac QH40_96 QH40_96_sh "Type of toilet facility: Other - shared". * What type of drainage facility does this household have?. dichotomize (QH46=1) QH46_1 "Type of drainage facility: Closed drainage". dichotomize (QH46=2) QH46_2 "Type of drainage facility: Open drainage". dichotomize (QH46=3) QH46_3 "Type of drainage facility: Drain to soak pit". dichotomize (QH46=4) QH46_4 "Type of drainage facility: No drainage". * Electricity. no2zero QH50A. * Mattress. no2zero QH50B. * Pressure cooker. no2zero QH50C. * Chair. no2zero QH50D. * Cot or bed. no2zero QH50E. * Table. no2zero QH50F. * Electric fan. no2zero QH50G. * Radio or transistor. no2zero QH50H. * Black and white television. no2zero QH50I. * Colour television. no2zero QH50J. * Sewing machine. no2zero QH50K. * Mobile telephone. no2zero QH50L. * Telephone (non-mobile). no2zero QH50M. * Internet. no2zero QH50N. * Computer. no2zero QH50O. * Refrigerator. no2zero QH50P. * Air conditioner/cooler. no2zero QH50Q. * Washing machine. no2zero QH50R. * Watch or clock. no2zero QH50S. * Bicycle. no2zero QH50T. * Motorcycle or Scooter. no2zero QH50U. * Animal-drawn cart. no2zero QH50V. * Car. no2zero QH50W. * Water pump. no2zero QH50X. * Thresher. no2zero QH50Y. * Tractor. no2zero QH50Z. * Type of cooking fuel. dichotomize (QH51=1) QH51_1 "Type of cooking fuel: Electricity". dichotomize (QH51=2) QH51_2 "Type of cooking fuel: LPG / natural gas". dichotomize (QH51=3) QH51_3 "Type of cooking fuel: Biogas". dichotomize (QH51=4) QH51_4 "Type of cooking fuel: Kerosene". dichotomize (QH51=5) QH51_5 "Type of cooking fuel: Coal / lignite". dichotomize (QH51=6) QH51_6 "Type of cooking fuel: Charcoal". dichotomize (QH51=7) QH51_7 "Type of cooking fuel: Wood". dichotomize (QH51=8) QH51_8 "Type of cooking fuel: Straw / shrubs / grass". dichotomize (QH51=9) QH51_9 "Type of cooking fuel: Agricultural crop waste". dichotomize (QH51=10) QH51_10 "Type of cooking fuel: Dung cakes". dichotomize (QH51=95) QH51_95 "Type of cooking fuel: No food cooked in household". dichotomize (QH51=96) QH51_96 "Type of cooking fuel: Other". * Main material of floor. dichotomize (QH57=11) QH57_11 "Main material of floor: Mud / clay / earth". dichotomize (QH57=12) QH57_12 "Main material of floor: Sand". dichotomize (QH57=13) QH57_13 "Main material of floor: Dung". dichotomize (QH57=21) QH57_21 "Main material of floor: Raw wood planks". dichotomize (QH57=22) QH57_22 "Main material of floor: Palm / bamboo". dichotomize (QH57=23) QH57_23 "Main material of floor: Brick". dichotomize (QH57=24) QH57_24 "Main material of floor: Stone". dichotomize (QH57=31) QH57_31 "Main material of floor: Parquet / polished wood". dichotomize (QH57=32) QH57_32 "Main material of floor: Vinyl / asphalt". dichotomize (QH57=33) QH57_33 "Main material of floor: Ceramic tiles". dichotomize (QH57=34) QH57_34 "Main material of floor: Cement". dichotomize (QH57=35) QH57_35 "Main material of floor: Carpet". dichotomize (QH57=36) QH57_36 "Main material of floor: Polished stone / marble / granite". dichotomize (QH57=96) QH57_96 "Main material of floor: Other". * Main roof material. dichotomize (QH58=11) QH58_11 "Main roof material: No roof". dichotomize (QH58=12) QH58_12 "Main roof material: Thatch / palm leaf / reed / grass". dichotomize (QH58=13) QH58_13 "Main roof material: Mud". dichotomize (QH58=14) QH58_14 "Main roof material: Sod / mud and grass mixture". dichotomize (QH58=15) QH58_15 "Main roof material: Plastic / polythene sheeting". dichotomize (QH58=21) QH58_21 "Main roof material: Rustic mat". dichotomize (QH58=22) QH58_22 "Main roof material: Palm / bamboo". dichotomize (QH58=23) QH58_23 "Main roof material: Raw wood planks / timber". dichotomize (QH58=24) QH58_24 "Main roof material: Unburnt brick". dichotomize (QH58=25) QH58_25 "Main roof material: Loosely packed stone". dichotomize (QH58=31) QH58_31 "Main roof material: Metal / GI". dichotomize (QH58=32) QH58_32 "Main roof material: Wood". dichotomize (QH58=33) QH58_33 "Main roof material: Calamine / cement fiber". dichotomize (QH58=34) QH58_34 "Main roof material: Asbestos sheets". dichotomize (QH58=35) QH58_35 "Main roof material: RCC / RBC / cement / concrete". dichotomize (QH58=36) QH58_36 "Main roof material: Roofing shingles". dichotomize (QH58=37) QH58_37 "Main roof material: Tiles". dichotomize (QH58=38) QH58_38 "Main roof material: Slate". dichotomize (QH58=39) QH58_39 "Main roof material: Burnt brick". dichotomize (QH58=96) QH58_96 "Main roof material: Other". * Main wall material. dichotomize (QH59=11) QH59_11 "Main wall material: No walls". dichotomize (QH59=12) QH59_12 "Main wall material: Cane / palm / trunks / bamboo". dichotomize (QH59=13) QH59_13 "Main wall material: Mud". dichotomize (QH59=14) QH59_14 "Main wall material: Grass / reeds / thatch". dichotomize (QH59=21) QH59_21 "Main wall material: Bamboo with mud". dichotomize (QH59=22) QH59_22 "Main wall material: Stone with mud". dichotomize (QH59=23) QH59_23 "Main wall material: Plywood". dichotomize (QH59=24) QH59_24 "Main wall material: Cardboard". dichotomize (QH59=25) QH59_25 "Main wall material: Unburnt brick". dichotomize (QH59=26) QH59_26 "Main wall material: Raw wood / reused wood". dichotomize (QH59=31) QH59_31 "Main wall material: Cement / concrete". dichotomize (QH59=32) QH59_32 "Main wall material: Stone with lime / cement". dichotomize (QH59=33) QH59_33 "Main wall material: Burnt bricks". dichotomize (QH59=34) QH59_34 "Main wall material: Cement blocks". dichotomize (QH59=35) QH59_35 "Main wall material: Wood planks / shingles". dichotomize (QH59=36) QH59_36 "Main wall material: GI/ metal / asbestos sheets". dichotomize (QH59=96) QH59_96 "Main wall material: Other". * Acres for agricultural land. compute landarea = QH65. if (missing(QH65) | QH65 >= 999.8) landarea = 999.9. if (missing(QH63) | QH63 <> 1) landarea=0. missing values landarea (999.9). * Cows / bulls / buffaloes / yaks. no2zero QH67A. * Camels. no2zero QH67B. * Horses / donkeys / mules. no2zero QH67C. * Goats. no2zero QH67D. * Sheep. no2zero QH67E. * Chickens / ducks. no2zero QH67F. * Bank account. no2zero QH70. *{Members per sleeping room}. if (hhusual=0) hhusual=hhslept. if (QH60>0) memsleep=trunc(hhusual/QH60). if (QH60=0) memsleep=hhusual. if (missing(QH60) or QH60>=99 or memsleep>=98) memsleep=99. variable labels memsleep 'Number of members per sleeping room'. value labels memsleep 0 'Less than 1 per room'. formats memsleep (f2.0). missing values memsleep (99). * Compute urban and rural variables coded (1/0) for filters later. compute urban=(QHTYPE = 1). compute rural=(QHTYPE = 2). variable labels urban 'Urban' / rural 'Rural'. value labels urban 1 'Urban' / rural 1 'Rural'. formats urban rural (f1.0). execute. * Check on indicator variable creation. frequencies variables=QHTYPE to memsleep. * Toilet facility by shared/not shared. crosstabs /tables=QH40 by QH42. frequencies variables= QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTIC DOMESTHH HOUSE LAND memsleep landarea . * Turn off weights before all factor analysis. weight off. * Name the dataset window for the HH data for use later. dataset name assets. save outfile='assets.sav'. *** Test Factor Analysis. filter off. execute. * Excluded Domestic, landarea. factor /variables QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /missing meansub /analysis QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /method=correlation. *** Common Factor analysis ***. ** Removed area-specific variables **. ** Agricultural animal variables excluded ** Land area excluded ** Any others ?. *** Common Factor Analysis. filter off. execute. * Excluded Domestic, landarea. factor /variables QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /missing meansub /analysis QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL com) /method=correlation. *** Urban Factor Analysis. filter off. filter by urban. execute. * Excluded Domestic, landarea. factor /variables QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /missing meansub /analysis QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL urb) /method=correlation. *** Rural Factor Analysis. filter off. filter by rural. execute. * Excluded Domestic, landarea. factor /variables QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /missing meansub /analysis QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL rur) /method=correlation. * Label the created score variables. rename variables (com1 urb1 rur1=comscore urbscore rurscore). variable labels comscore 'Common wealth score' /urbscore 'Urban wealth score' /rurscore 'Rural wealth score'. * Add a variable used for linking later. filter off. string rowtype_ (A8). compute rowtype_ = 'EST'. * Calculate regressions. ** Area=urban. filter off. filter by urban. execute. * Declare a dataset to be written to in the regression. dataset declare urbancorv. * Run regression of comscore with urbscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter urbscore /outfile=corv(urbancorv). * Activate file of output from regression. dataset activate urbancorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=urbconst urbscore=urbcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = urbancorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=rural. filter off. filter by rural. execute. * Declare a dataset to be written to in the regression. dataset declare ruralcorv. * Run regression of comscore with rurscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter rurscore /outfile=corv(ruralcorv). * Activate file of output from regression. dataset activate ruralcorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=rurconst rurscore=rurcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = ruralcorv /by ROWTYPE_. execute. dataset close urbancorv. dataset close ruralcorv. dataset activate assets. filter off. *** Calculate combined wealth score from Urban and Rural Scores. * Use coefficients from urban and rural regressions above. compute combscor=0. print formats combscor (f11.5). write formats combscor (f11.5). ** Urban. if (urban = 1) combscor=urbconst+urbcoeff*urbscore. ** Rural. if (rural = 1) combscor=rurconst+rurcoeff*rurscore. variable labels combscor 'Combined national wealth score'. execute. * Switch to QHWEIGHTN for national. *compute hhwt = QHWEIGHT/1000000. compute hhwt = QHWEIGHTN/1000000. variable labels hhwt 'HH weights'. formats hhwt (f12.6). weight by hhwt. filter off. execute. frequencies variables=combscor comscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by urban. execute. frequencies variables=combscor urbscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by rural. execute. frequencies variables=combscor rurscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. execute. *Calculate quintiles and scores for data file. *Switch to QHWEIGHTN for national. *compute hhmemwt=QHWEIGHT*hhusual/1000000. compute hhmemwt=QHWEIGHTN*hhusual/1000000. variable labels hhmemwt 'HH members weighting for index'. formats hhmemwt (f12.6). weight by hhmemwt. filter off. filter by urban. execute. rank variables=urbscore (A) /rank /ntiles (5) /print=yes /ties=mean. rank variables=urbscore (A) by QHSTATE /rank /ntiles (5) /print=yes /ties=mean. filter off. filter by rural. execute. rank variables=rurscore (A) /rank /ntiles (5) /print=yes /ties=mean. rank variables=rurscore (A) by QHSTATE /rank /ntiles (5) /print=yes /ties=mean. filter off. execute. rank variables=combscor (A) /rank /ntiles (5) /print=yes /ties=mean. rank variables=combscor (A) by QHSTATE /rank /ntiles (5) /print=yes /ties=mean. delete variables RAN001 RAN002 RAN003. rename variables NTI001=Nurb_s NTI002=Nrur_s NTI003=Ncomb_s. variable labels ncombsco 'Combined wealth index' /nurbscor 'Urban wealth index' /nrurscor 'Rural wealth index' ncomb_s 'Combined wealth index within state' /nurb_s 'Urban wealth index within state' /nrur_s 'Rural wealth index within state'. value labels ncombsco nurbscor nrurscor ncomb_s nurb_s nrur_s 1 'Lowest' 2 'Second' 3 'Middle' 4 'Fourth' 5 'Highest'. crosstabs /tables=QHSTATE by ncombsco /cells=count row /count=asis. *** Check on quintiles. frequencies variables=ncombsco nurbscor nrurscor ncomb_s nurb_s nrur_s. weight by hhwt. * Exclude domestic landarea. ctables /table ( QH34_11+QH34_12+QH34_13+QH34_14+QH34_21+QH34_31+QH34_32+QH34_41+QH34_42+QH34_51+QH34_61+QH34_71+QH34_81+QH34_91+QH34_92+QH34_96+ QH40_11+QH40_12+QH40_13+QH40_14+QH40_15+QH40_21+QH40_22+QH40_23+QH40_31+QH40_41+QH40_51+QH40_96+ QH40_11_sh+QH40_12_sh+QH40_13_sh+QH40_14_sh+QH40_15_sh+QH40_21_sh+QH40_22_sh+QH40_23_sh+QH40_31_sh+QH40_41_sh+QH40_96_sh+ QH46_1+QH46_2+QH46_3+QH46_4+ QH50A+QH50B+QH50C+QH50D+QH50E+QH50F+QH50G+QH50H+QH50I+QH50J+QH50K+QH50L+QH50M+QH50N+QH50O+QH50P+QH50Q+QH50R+QH50S+QH50T+QH50U+QH50V+QH50W+QH50X+QH50Y+QH50Z+ QH51_1+QH51_2+QH51_3+QH51_4+QH51_5+QH51_6+QH51_7+QH51_8+QH51_9+QH51_10+QH51_95+QH51_96+ QH57_11+QH57_12+QH57_13+QH57_21+QH57_22+QH57_23+QH57_24+QH57_31+QH57_32+QH57_33+QH57_34+QH57_35+QH57_36+QH57_96+ QH58_11+QH58_12+QH58_13+QH58_14+QH58_15+QH58_21+QH58_22+QH58_23+QH58_24+QH58_25+QH58_31+QH58_32+QH58_33+QH58_34+QH58_35+QH58_36+QH58_37+QH58_38+QH58_39+ QH58_96+QH59_11+QH59_12+QH59_13+QH59_14+QH59_21+QH59_22+QH59_23+QH59_24+QH59_25+QH59_26+QH59_31+QH59_32+QH59_33+QH59_34+QH59_35+QH59_36+QH59_96+ QH67A+QH67B+QH67C+QH67D+QH67E+QH67F+QH70+DOMESTHH+HOUSE+LAND+memsleep )[S][Mean F8.3] by (ncombsco+nurbscor+nrurscor)[C] /slabels visible=no. * For state quintiles. * Exclude domestic landarea. ctables /table ( QH34_11+QH34_12+QH34_13+QH34_14+QH34_21+QH34_31+QH34_32+QH34_41+QH34_42+QH34_51+QH34_61+QH34_71+QH34_81+QH34_91+QH34_92+QH34_96+ QH40_11+QH40_12+QH40_13+QH40_14+QH40_15+QH40_21+QH40_22+QH40_23+QH40_31+QH40_41+QH40_51+QH40_96+ QH40_11_sh+QH40_12_sh+QH40_13_sh+QH40_14_sh+QH40_15_sh+QH40_21_sh+QH40_22_sh+QH40_23_sh+QH40_31_sh+QH40_41_sh+QH40_96_sh+ QH46_1+QH46_2+QH46_3+QH46_4+ QH50A+QH50B+QH50C+QH50D+QH50E+QH50F+QH50G+QH50H+QH50I+QH50J+QH50K+QH50L+QH50M+QH50N+QH50O+QH50P+QH50Q+QH50R+QH50S+QH50T+QH50U+QH50V+QH50W+QH50X+QH50Y+QH50Z+ QH51_1+QH51_2+QH51_3+QH51_4+QH51_5+QH51_6+QH51_7+QH51_8+QH51_9+QH51_10+QH51_95+QH51_96+ QH57_11+QH57_12+QH57_13+QH57_21+QH57_22+QH57_23+QH57_24+QH57_31+QH57_32+QH57_33+QH57_34+QH57_35+QH57_36+QH57_96+ QH58_11+QH58_12+QH58_13+QH58_14+QH58_15+QH58_21+QH58_22+QH58_23+QH58_24+QH58_25+QH58_31+QH58_32+QH58_33+QH58_34+QH58_35+QH58_36+QH58_37+QH58_38+QH58_39+ QH58_96+QH59_11+QH59_12+QH59_13+QH59_14+QH59_21+QH59_22+QH59_23+QH59_24+QH59_25+QH59_26+QH59_31+QH59_32+QH59_33+QH59_34+QH59_35+QH59_36+QH59_96+ QH67A+QH67B+QH67C+QH67D+QH67E+QH67F+QH70+DOMESTHH+HOUSE+LAND+memsleep )[S][Mean F8.3] by (ncomb_s+nurb_s+nrur_s)[C] /slabels visible=no. * Exclude domestic landarea. * Alternative instead of ctables. *means tables= QH34_11 QH34_12 QH34_13 QH34_14 QH34_21 QH34_31 QH34_32 QH34_41 QH34_42 QH34_51 QH34_61 QH34_71 QH34_81 QH34_91 QH34_92 QH34_96 QH40_11 QH40_12 QH40_13 QH40_14 QH40_15 QH40_21 QH40_22 QH40_23 QH40_31 QH40_41 QH40_51 QH40_96 QH40_11_sh QH40_12_sh QH40_13_sh QH40_14_sh QH40_15_sh QH40_21_sh QH40_22_sh QH40_23_sh QH40_31_sh QH40_41_sh QH40_96_sh QH46_1 QH46_2 QH46_3 QH46_4 QH50A QH50B QH50C QH50D QH50E QH50F QH50G QH50H QH50I QH50J QH50K QH50L QH50M QH50N QH50O QH50P QH50Q QH50R QH50S QH50T QH50U QH50V QH50W QH50X QH50Y QH50Z QH51_1 QH51_2 QH51_3 QH51_4 QH51_5 QH51_6 QH51_7 QH51_8 QH51_9 QH51_10 QH51_95 QH51_96 QH57_11 QH57_12 QH57_13 QH57_21 QH57_22 QH57_23 QH57_24 QH57_31 QH57_32 QH57_33 QH57_34 QH57_35 QH57_36 QH57_96 QH58_11 QH58_12 QH58_13 QH58_14 QH58_15 QH58_21 QH58_22 QH58_23 QH58_24 QH58_25 QH58_31 QH58_32 QH58_33 QH58_34 QH58_35 QH58_36 QH58_37 QH58_38 QH58_39 QH58_96 QH59_11 QH59_12 QH59_13 QH59_14 QH59_21 QH59_22 QH59_23 QH59_24 QH59_25 QH59_26 QH59_31 QH59_32 QH59_33 QH59_34 QH59_35 QH59_36 QH59_96 QH67A QH67B QH67C QH67D QH67E QH67F QH70 DOMESTHH HOUSE LAND memsleep by ncombsco nurbscor nrurscor /cells mean count stddev. graph /histogram(normal)=combscor /title= 'Distribution of Households by Wealth Scores'. frequencies variables=combscor /format=notable /ntiles=5 /statistics=stddev minimum maximum semean mean median mode skewness seskew kurtosis sekurt /order=analysis. weight off. filter off. write formats combscor urbscore rurscore (f11.5). * Save final dataset of assets. save outfile='assets.sav'. *** Write out scores file. write outfile='scores.dat' table /QHSTATE QHDIST QHPSU QHNUMBER combscor ncombsco ncomb_s urbscore nurbscor nurb_s rurscore nrurscor nrur_s. execute. * Produce table 2.6 weighted by de jure population to test. weight by hhmemwt. compute total = 0. variable labels total 'Total'. value labels total 0 ' '. ctables /vlabels variables=QHSTATE QHTYPE total Ncombsco display=both /table QHSTATE [C] + QHTYPE [C] + total [C] BY Ncombsco [C][rowpct.count '%' F8.1, totals [rowpct.count '%' F8.1, count '' F8.0]] /categories variables=Ncombsco total=yes /titles title='Table 2.6 Wealth Quintiles' '' 'Percent distribution of the de jure population by wealth quintiles, according to residence and region, India NFHS 2019-20' corner='Residence/region' /slabels visible=no. ctables /vlabels variables=QHSTATE QHTYPE total Ncomb_s display=both /table QHSTATE [C] > (QHTYPE [C] + total [C]) + total [C] BY Ncomb_s [C][rowpct.count '%' F8.1, totals [rowpct.count '%' F8.1, count '' F8.0]] /categories variables=Ncomb_s total=yes /titles title='Table 2.6a State Wealth Quintiles' '' 'Percent distribution of the de jure population by state wealth quintiles, according to residence and region, India NFHS 2019-20' corner='Residence/region' /slabels visible=no.